import { createRouter, createWebHashHistory } from "vue-router";
import Home from "../views/Home.vue";
import Main from "../views/Main.vue";
import dashboard from "../views/dashboard/index.vue";
import table_one from "../views/TableOne/index.vue";
import table_two from "../views/TableTwo/index.vue";
import table_three from "../views/TableThree/index.vue";
import table_four from "../views/TableFour/index.vue";
import table_five from "../views/TableFive/index.vue";
import table_six from "../views/TableSix/index.vue";
import table_seven from "../views/TableSeven/index.vue";
import job_dash from "../views/job_dash/index.vue";

const routes = [
  {
    //导航栏是Home，首页是Main，请把页面都作为导航栏的子路由（children），如下：
    path: "/",
    name: "home",
    component: Home,
    children: [
      {
        path: "/", //以“/”开头的嵌套路径会被当作根路径，所以子路由上不用加“/”;在生成路由时，主路由上的path会被自动添加到子路由之前，所以子路由上的path不用在重新声明主路由上的path了。
        name: "main",
        component: Main,
      },
      {
        path: "/job_dash",
        name: "job-dash",
        component: job_dash,
      },
      {
        path: "/dash",
        name: "dashboard",
        component: dashboard,
      },
      {
        path: "/one",
        name: "table_one",
        component: table_one,
      },
      {
        path: "/two",
        name: "table_two",
        component: table_two,
      },
      {
        path: "/three",
        name: "table_three",
        component: table_three,
      },
      {
        path: "/four",
        name: "table_four",
        component: table_four,
      },
      {
        path: "/five",
        name: "table_five",
        component: table_five,
      },
      {
        path: "/six",
        name: "table_six",
        component: table_six,
      },
      {
        path: "/seven",
        name: "table_seven",
        component: table_seven,
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
